﻿@model IEnumerable<HanGu.Entity.vwMemberContact>
@{
    Layout = null;
    int i = 1;
    ViewBag.ViewTitle = "联系记录";
    var SearchParma = ViewData["SearchParma"] as HanGu.Entity.UniversallySearchParam;
    var action = Request["action"];
    var read = action != null && action == "read";
}
<div class="pageContent">
    <div class="tabs" currentindex="0" eventtype="chick">
        <div class="tabsHeader">
            <div class="tabsHeaderContent">
                <ul>
                    <li><a><span>联系记录</span></a></li>
                    <li><a href="/Message/Default/MsgByMember/@ViewData["ParentID"]?action=" class="j-ajax">
                        <span>群发记录</span></a></li>
                </ul>
            </div>
        </div>
        <div class="tabsContent">
            <div id="GroupMessage">
                <script>
                    function mydialogAjaxDone(json) {
                        DWZ.ajaxDone(json);
                        if (json.statusCode == DWZ.statusCode.ok) {
                            if (json.navTabId) {
                                var $this = $("#" + json.navTabId);
                                $this.loadUrl($this.attr("ref"));
                            } else if (json.rel) {
                                navTabPageBreak({}, json.rel);
                            }
                            if ("closeCurrent" == json.callbackType) {
                                $.pdialog.closeCurrent();
                            }
                        }
                    }
                   
                </script>
                @if (!read)
                {
                    <div class="panelBar">
                        <ul class="toolBar">
                            <li><a class="add" href='CustomerInfo/MemberContact/create/0/@ViewData["ParentID"]' width="800" height="500" target="dialog" title="添加-@ViewBag.ViewTitle">
                                <span>添加</span></a></li>
                        </ul>
                    </div>
                }
                <table class="table" width="100%">
                    <thead>
                        <tr class="header">
                            <th>
                                序号
                            </th>
                            <th>
                                类型
                            </th>
                            <th>
                                内容
                            </th>
                            <th>
                                创建人
                            </th>
                            <th>
                                创建时间
                            </th>
                            <th>
                            </th>
                        </tr>
                    </thead>
                    @foreach (var item in Model)
                    {                                
                        <tr target="Message_id" rel="@item.ID" >
                            <td>
                                @i
                            </td>
                            <td>
                                @item.TypeName
                            </td>
                            <td>
                                @MvcHtmlString.Create(item.Remark)
                            </td>
                            <td>
                                @item.Creator
                            </td>
                            <td>
                                <span formatdate="yyyy-MM-dd HH:mm">
                                    @item.CreateTime</span>
                            </td>
                            <td>
                                @if (!read)
                                {
                                    <a class="" href="CustomerInfo/MemberContact/create/@item.ID/@ViewData["ParentID"]?action=edit" target="dialog"  width="800" height="500" title="修改-@ViewBag.ViewTitle">
                                        <span>修改</span></a> <span>&nbsp;</span> 
                                    <a class="" href="CustomerInfo/MemberContact/Delete/@item.ID/@ViewData["ParentID"]" callback="mydialogAjaxDone" target="ajaxTodo" title="确定要删除吗？">
                                        <span>删除</span></a>
                                }
                            </td>
                        </tr>
                                i += 1;
                    }
                </table>
            </div>
            <div id="MsgByMemberDiv" rel="/Message/Default/MsgByMember/@ViewData["ParentID"]?action="></div>
        </div>
    </div>
</div>
